import request from '@/utils/request'
import { ApiModulesRoutes } from '@/consts.js'

/**
 * 查询算法事件
 * @param eventId 算法事件Id
 * @return {Promise<void>}
 */
export const apiFindAlgEventById = async(eventId) => {
  const url = ApiModulesRoutes.BASE + '/alg/event/findAlgEventById'
  return await request.get(url, { params: { eventId } })
}

/**
 * 下载事件报告
 * @param eventId
 * @return {Promise<AxiosResponse<any>>}
 */
export const ApiExportAlgEventExcelReport = async(eventId) => {
  const url = ApiModulesRoutes.BASE + '/alg/event/exportAlgEventExcelReport'
  return request({
    url,
    responseType: 'blob',
    method: 'GET',
    params: { eventId }
  })
}

/**
 * 算法事件标记解决
 * @param eventId 事件id
 * @return {Promise<AxiosResponse<any>>}
 */
export const apiSolveAlgEvent = async(eventId) => {
  const url = ApiModulesRoutes.BASE + '/alg/event/solveAlgEvent'
  return await request.get(url, { params: { eventId } })
}
